package wetalk.software.bupt.com.wetalk.model.po;

import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by zhangjie on 2017/12/6.
 */

public class Pointer implements Serializable{
    private static final long serialVersionUID = -2906907910428442090L;
    private String __type = "Pointer";
    private String className;
    private String objectId;
    private static JSONObject params;
    //TODO:need implement
    //private static of requestCommand;
    //private static This rApi$6fc396a8;

    public Pointer() {
    }

    public Pointer(String className, String objectId) {
        this.setClassName(className);
        this.setObjectId(objectId);
    }

    public Pointer(Object value) {
        if(value instanceof User) {
            User value3 = (User)value;
            this.setClassName("_User");
            this.setObjectId(String.valueOf(value3.getUserID()));
        } else if(value instanceof WeTalkRole) {
            WeTalkRole value2 = (WeTalkRole)value;
            this.setClassName(WeTalkRole.tableName);
            this.setObjectId(value2.getObjectId());
        } else {
            if(value instanceof WeTalkObject) {
                WeTalkObject value1 = (WeTalkObject)value;
                this.setClassName(value1.getClass().getSimpleName());
                this.setObjectId(value1.getObjectId());
            }

        }
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

}
